import React, { Component } from 'react';
import {
    Image,StyleSheet,AppRegistry,Text,View,ScrollView,TouchableOpacity,FlatList,Platform
    } from 'react-native';
import {StackNavigator} from 'react-navigation';
import Notice from './Notice';
import Product from './Product';
import Banner from './Banner';
import Zizhi from './Zizhi';
import Home from './BannerImg';
import pxToDp from '../common/comm';
import ProductWebview from './ProductWebview';
import Login from './Login';
import MyIndex from './MyIndex.js';
import * as DATA from '../data/data';
import * as COMM from '../common/comm';



export default Index = StackNavigator({
    MyIndex:{
        screen:MyIndex
    },
    Notice: {
        screen: Notice,
        navigationOptions: {
            headerTintColor:'#fff',
            headerTitle: '公告',
            headerStyle: {
                backgroundColor: DATA.BASE_COLOR,
                height: Platform.OS === 'android'?pxToDp(84):pxToDp(110)
            },
            headerTitleStyle: {
                color: '#fff',
                fontSize: pxToDp(34),
                marginLeft:Platform.OS === 'android'?pxToDp(225):null
            },
            gesturesEnabled :true
        }},
    Product: {
        screen: Product,
        navigationOptions : {
            headerTintColor:'#fff',
            headerRight:COMM.shareBtn(),
            headerTitle: '产品详情',
            headerStyle: {
                backgroundColor: DATA.BASE_COLOR,
                height:Platform.OS === 'android'?pxToDp(84):pxToDp(110)
            },
            headerTitleStyle: {
                color: '#fff',
                fontSize: pxToDp(34),
                marginLeft:Platform.OS === 'android'?pxToDp(185):null
            },
            gesturesEnabled :true
        }
    },
    Banner: {
        screen: Banner,
        navigationOptions : {
            headerTintColor:'#fff',
            headerRight:COMM.shareBtn(),
            headerTitle: '活动详情',
            headerStyle: {
                backgroundColor: DATA.BASE_COLOR,
                height:Platform.OS === 'android'?pxToDp(84):pxToDp(110)
            },
            headerTitleStyle: {
                color: '#fff',
                fontSize: pxToDp(34),
                marginLeft:Platform.OS === 'android'?pxToDp(180):null
            },
            gesturesEnabled :true
        }
    },
    Zizhi: {
        screen: Zizhi,
        navigationOptions : {
            headerTintColor:'#fff',
            headerRight:COMM.shareBtn(),
            headerTitle: '平台资质',
            headerStyle: {
                backgroundColor: DATA.BASE_COLOR,
                height:Platform.OS === 'android'?pxToDp(84):pxToDp(110)
            },
            headerTitleStyle: {
                color: '#fff',
                fontSize: pxToDp(34),
                marginLeft:Platform.OS === 'android'?pxToDp(180):null
            },
            gesturesEnabled :true
        }
    },
    ProductWebview:{
        screen:ProductWebview,
        navigationOptions : {
            headerTintColor:'#fff',
            headerRight:<TouchableOpacity
                onPress={() => {
                //TODO
                }}>
                <Image
                    source={{uri:DATA.SHARE_IMG}}
                    style={{
                        marginRight: pxToDp(20),
                        width: pxToDp(45),
                        height:pxToDp(64)
                }}>
                </Image>
            </TouchableOpacity>,
            headerTitle: '投资平台',
            headerStyle: {
                backgroundColor: DATA.BASE_COLOR,
                height:Platform.OS === 'android'?pxToDp(84):pxToDp(110)
            },
            headerTitleStyle: {
                color: '#fff',
                fontSize: pxToDp(34),
                marginLeft:Platform.OS === 'android'?pxToDp(180):null
            },
            gesturesEnabled :true
        }

    },
    Login:{
        screen:Login
    }
},{
});

let styles = StyleSheet.create({
    itemContainer: {
        flexDirection: 'row',
        alignItems:'center',
        backgroundColor:'#fff',
        marginTop:pxToDp(2),
        paddingTop:pxToDp(6),
        paddingBottom:pxToDp(6)
    },
    itemLogo:{
        width:pxToDp(160),
        height:pxToDp(160),
        margin:pxToDp(20)
    },
    itemContent:{
      marginLeft:pxToDp(20),
    },
    itemName:{
        fontSize:pxToDp(30),
        fontWeight:'900'
    },
    itemKeys:{
        flexDirection:'row',
        width:pxToDp(350),
        marginLeft:pxToDp(-10),
        marginTop:pxToDp(10),
    },
    itemkey:{
        flex:1,
        color:'#f00',
        textAlign:'center',
        width:pxToDp(300),
    },
    itemShuoming:{
        marginTop:pxToDp(10)
    }
});
